home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / overview / dtscpluslibrary / sources / userterminationtest.cp < prev    next >
Encoding:
Text File  |  2000-09-28  |  1.7 KB  |  52 lines

  1. /*
  2.     File:        UserTerminationTest.cp
  3.  
  4.     Contains:    TUserTermination is a command dot tracking class, used for finding out if the end user wants to stop
  5.                   an action. Most of the code is based on earlier snippet by Dave Radcliffe/DTS.
  6.                   TUserTerminationTest .cp contains the class testing functions.
  7.  
  8.     Written by: Kent Sandvik    
  9.  
  10.     Copyright:    Copyright © 1999 by Apple Computer, Inc., All Rights Reserved.
  11.  
  12.                 You may incorporate this Apple sample source code into your program(s) without
  13.                 restriction. This Apple sample source code has been provided "AS IS" and the
  14.                 responsibility for its operation is yours. You are not permitted to redistribute
  15.                 this Apple sample source code as "Apple sample source code" after having made
  16.                 changes. If you're going to re-distribute the source, we require that you make
  17.                 it clear in the source that the code was descended from Apple sample source
  18.                 code, but that you've made changes.
  19.  
  20.     Change History (most recent first):
  21.                 8/18/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  22.                 
  23.  
  24. */
  25. #include "UserTermination.h"
  26.  
  27. // This test will create one TUserTermination class on the stack, and abort when the
  28. // user hits "command-.".
  29.  
  30. void main(void)
  31. {
  32.     cout << "Start of TUserTermination test…\n";
  33.  
  34.     TUserTermination myTerminator;
  35.  
  36.     // run a loop, terminate when command-dot is pressed
  37.     Boolean pressed = false;
  38.     while (!pressed)
  39.     {
  40.         pressed = myTerminator.Abort();
  41.     }
  42.  
  43.     cout << "End of TUserTermination test…\n";
  44. }
  45.  
  46. // _________________________________________________________________________________________________________ //
  47.  
  48. /*    Change History (most recent last):
  49.   No        Init.    Date        Comment
  50.   1            khs        9/26/92        New file
  51. */
  52.